package com.flw.eslab.web.util;

public class Estimate {

	// ������ݵġ�*������
	public static int Counter_1(String a) {
		char temp[] = a.toCharArray();
		int counter = 0;
		for (char c : temp)
			if (c == '*')
				counter++;

		return counter;
	}

	public static int Counter_2(String a) {
		String numStr = "0123456789";
		int counter = 0;
		char temp[] = a.toCharArray();
		for (char c : temp) {
			if (numStr.indexOf(c) >= 0)
				counter++;
		}
		return counter;

	}

	public static int Counter_3(String a) {
		String numStr = "0123456789" + '*';
		int counter = 0;
		char temp[] = a.toCharArray();
		for (char c : temp) {
			if (numStr.indexOf(c) >= 0)
				counter++;
		}
		return counter;
	}

	// ��λ��ʮλ��1��?λ��0Ϊͬ��;��λ��XΪX��λ��Xͬ��
	public static String setKind(String Str) {
		int i = Counter_1(Str);
		int k = Counter_2(Str);
		int j = Counter_3(Str);
		if (i == 0)// ͬ��
			switch (k) {
			case 4:
				return "14";
			case 3:
				return "13";
			case 2:
				return "12";
			}
		else if (j == 4)// ��λ
			switch (i) {
			case 1:
				return "03";
			case 2:
				return "02";
			}

		return "2";
	}

}
